GetShare

Syntax: @GetShare flagnum, status

The GetShare command tries to lock flag number flagnum. If successful this returns 1 (true) in status otherwise it returns 0 (false). This can be used to enable file locking for multiple users of XpertRule, by testing and locking a designated flag number, before performing read/write operations on external files. Once the operations have been completed, ReleaseShare can be used to unlock the flag, so that other XpertRule users can access the files.

Flagnum can be numeric literal, numeric array, numeric attribute or numeric variable, with an allowable range of 1 to 20. Status can be a numeric array, numeric attribute or numeric variable.

Example

In a list attribute Grablock with the values ERROR and OK:-

@GetShare 1,num[1]
@If num[1] = 0
  @Assign GrabLock = 'ERROR'
@Else
  @Assign GrabLock = 'OK'
@Endif